package com.woniu.aftercare.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 售后单审核记录
 * @TableName review
 */
@TableName(value ="review")
@Data
public class Review implements Serializable {
    /**
     * 审核记录ID
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 关联售后单ID
     */
    private Long afterSalesOrderId;

    /**
     * 审核人ID
     */
    private Long reviewerId;

    /**
     * 审核结果: 同意、拒绝
     */
    private String result;

    /**
     * 备注
     */
    private String comments;

    /**
     * 审核步骤, 如初审、终审
     */
    private String reviewStep;

    /**
     * 审核人姓名
     */
    private String reviewerName;

    /**
     * 审核人工号
     */
    private String reviewerStaffId;

    /**
     * 创建时间
     */
    private Date createdAt;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Review other = (Review) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getAfterSalesOrderId() == null ? other.getAfterSalesOrderId() == null : this.getAfterSalesOrderId().equals(other.getAfterSalesOrderId()))
            && (this.getReviewerId() == null ? other.getReviewerId() == null : this.getReviewerId().equals(other.getReviewerId()))
            && (this.getResult() == null ? other.getResult() == null : this.getResult().equals(other.getResult()))
            && (this.getComments() == null ? other.getComments() == null : this.getComments().equals(other.getComments()))
            && (this.getReviewStep() == null ? other.getReviewStep() == null : this.getReviewStep().equals(other.getReviewStep()))
            && (this.getReviewerName() == null ? other.getReviewerName() == null : this.getReviewerName().equals(other.getReviewerName()))
            && (this.getReviewerStaffId() == null ? other.getReviewerStaffId() == null : this.getReviewerStaffId().equals(other.getReviewerStaffId()))
            && (this.getCreatedAt() == null ? other.getCreatedAt() == null : this.getCreatedAt().equals(other.getCreatedAt()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getAfterSalesOrderId() == null) ? 0 : getAfterSalesOrderId().hashCode());
        result = prime * result + ((getReviewerId() == null) ? 0 : getReviewerId().hashCode());
        result = prime * result + ((getResult() == null) ? 0 : getResult().hashCode());
        result = prime * result + ((getComments() == null) ? 0 : getComments().hashCode());
        result = prime * result + ((getReviewStep() == null) ? 0 : getReviewStep().hashCode());
        result = prime * result + ((getReviewerName() == null) ? 0 : getReviewerName().hashCode());
        result = prime * result + ((getReviewerStaffId() == null) ? 0 : getReviewerStaffId().hashCode());
        result = prime * result + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", afterSalesOrderId=").append(afterSalesOrderId);
        sb.append(", reviewerId=").append(reviewerId);
        sb.append(", result=").append(result);
        sb.append(", comments=").append(comments);
        sb.append(", reviewStep=").append(reviewStep);
        sb.append(", reviewerName=").append(reviewerName);
        sb.append(", reviewerStaffId=").append(reviewerStaffId);
        sb.append(", createdAt=").append(createdAt);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}